package com.embrace.service.impl;

import com.embrace.entity.Student;
import com.embrace.mapper.StudentMapper;
import com.embrace.service.StudentService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;


@AllArgsConstructor
@Service
public class StudentServiceImpl implements StudentService {

    private final StudentMapper studentMapper;

    @Override
    public Student getStudentById(Integer id) {
        return studentMapper.getStudentById(id);
    }

    @Override
    public Boolean insertStudent(Integer id, String name, Integer age, String gender, String major) {
        return 1 == studentMapper.insertStudent(id, name, age, gender, major);
    }

    @Override
    public Boolean updateStudentById(Integer id) {
        return 1 == studentMapper.updateStudentById(id);
    }

    @Override
    public Boolean deleteStudentById(Integer id) {
        return 1 == studentMapper.deleteStudentById(id);
    }


}
